
class P743_39643 {

	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuffer buffer = new StringBuffer();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString()).trim();
	}

	public static void main(String[] args) {
		String line = readLn();
		
		while (!"0".equals(line)) {
			try {
				System.out.println(produce(line));
			} catch (Exception e) {
				System.out.println("NOT ACCEPTABLE");
			}
			
			line = readLn();
		}
		
	}

	private static String produce(String string) throws Exception {
		
		
		if (string.indexOf("0") > -1) throw new Exception();
		else if (string.charAt(0) == '2') {
			if (string.length() > 1) {
//				System.out.println(string + " produces " + string.substring(1));
				return string.substring(1);
			}
			else throw new Exception();
		}
		else if (string.charAt(0) == '3') {
//			System.out.println("What does " + string + " produce?");
			String sub = string.substring(1);
			String y = produce(sub);
//			System.out.println(string + " produces " + y + sub);
			return y + 2 + y;
		}
		else throw new Exception();
	}
	
}
